SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE dbo.[DISC_StampPermissionUpdate]
   @distID varchar(50),
   @permID nvarchar(50),
   @permissions nvarchar(max)
AS
BEGIN
	DELETE FROM [DISC_StampPermission] WHERE distID = @distID AND permID = @permID

	INSERT INTO [DISC_StampPermission] ([distID], [permID], [permissions])
	VALUES (@distID, @permID, @permissions)

	SELECT scope_identity()
END
GO
